package plataforma.base.cgd;

import javax.persistence.Query;

import org.springframework.stereotype.Repository;

import plataforma.base.cdp.Arquivo;
import plataforma.crudestatico.cgd.DaoBase;

@Repository
public class DaoArquivo extends DaoBase<Arquivo>{
	
	@Override
	public Arquivo recuperarPorId(Long id) {
		String hql = "select distinct a from Arquivo a  "				
				+ " where o.id=:parId";

		Query query = getEntityManager().createQuery(hql);
		query.setParameter("parId", id);

		return (Arquivo) query.getSingleResult();
	}

}
